package com.itheima.admin.mapper;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;

public interface UserRoleMapper {
    @Delete("delete from ss_role_user where user_id = #{id}")
    boolean deleteById(String id);

    @Insert({"INSERT INTO ss_user (\n" +
            "    user_id,\n"+
            "    email,\n" +
            "    password,\n" +
            "    user_name,\n" +
            "    dept_id,\n" +
            "    gender,\n" +
            "    state,\n" +
            "    birthday,\n" +
            "    join_date,\n" +
            "    telephone)\n" +
            "VALUES (\n" +
            "    #{userId},\n" +
            "    #{email},\n" +
            "    #{password},\n" +
            "    #{userName},\n" +
            "    #{deptId},\n" +
            "    #{gender},\n" +
            "    #{state},\n" +
            "    #{birthday},\n" +
            "    #{joinDate},\n" +
            "    #{telephone})"})
    boolean addUser(String userId,String email, String password,
                    String userName,
                    String deptId, String gender, String state, String birthday, String joinDate, String telephone);

    boolean editUser(String userId,String email, String password, String userName, String deptId, String gender, String state, String birthday, String joinDate, String telephone);

    boolean roleUser(String userId, String[] roleIds);
}
